package com.easymin.weixin.entity.passenger;

import com.alibaba.fastjson.annotation.JSONField;

import java.io.Serializable;
import java.util.Date;

/**
 * 乘客常用地址.
 *
 * @author Administrator
 */
public class PassengerAddress implements Serializable {
  private Long id;

  private String address; // 常用地址

  private String addressDetail; // 详细地址

  private Double latitude; // 纬度

  private Double longitude; // 经度

  private Integer type; // 类型:0家,1公司,2其他

  private Long passenger_id; // 乘客Id

  private Date created;

  private Date updated;
  @JSONField(serialize = false, deserialize = false)
  private Integer version;

  private static final long serialVersionUID = 1L;

  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public String getAddress() {
    return address;
  }

  public void setAddress(String address) {
    this.address = address == null ? null : address.trim();
  }

  public String getAddressDetail() {
    return addressDetail;
  }

  public void setAddressDetail(String addressDetail) {
    this.addressDetail = addressDetail;
  }

  public Double getLatitude() {
    return latitude;
  }

  public void setLatitude(Double latitude) {
    this.latitude = latitude;
  }

  public Double getLongitude() {
    return longitude;
  }

  public void setLongitude(Double longitude) {
    this.longitude = longitude;
  }

  public Integer getType() {
    return type;
  }

  public void setType(Integer type) {
    this.type = type;
  }

  public Long getPassenger_id() {
    return passenger_id;
  }

  public void setPassenger_id(Long passenger_id) {
    this.passenger_id = passenger_id;
  }

  public Date getCreated() {
    return created;
  }

  public void setCreated(Date created) {
    this.created = created;
  }

  public Date getUpdated() {
    return updated;
  }

  public void setUpdated(Date updated) {
    this.updated = updated;
  }

  public Integer getVersion() {
    return version;
  }

  public void setVersion(Integer version) {
    this.version = version;
  }

  @Override
  public boolean equals(Object that) {
    if (this == that) {
      return true;
    }
    if (that == null) {
      return false;
    }
    if (getClass() != that.getClass()) {
      return false;
    }
    PassengerAddress other = (PassengerAddress) that;
    return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
        && (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(
            other.getAddress()))
        && (this.getLatitude() == null ? other.getLatitude() == null : this.getLatitude().equals(
            other.getLatitude()))
        && (this.getLongitude() == null ? other.getLongitude() == null : this.getLongitude()
            .equals(other.getLongitude()))
        && (this.getType() == null ? other.getType() == null : this.getType().equals(
            other.getType()))
        && (this.getPassenger_id() == null ? other.getPassenger_id() == null : this
            .getPassenger_id().equals(other.getPassenger_id()))
        && (this.getCreated() == null ? other.getCreated() == null : this.getCreated().equals(
            other.getCreated()))
        && (this.getUpdated() == null ? other.getUpdated() == null : this.getUpdated().equals(
            other.getUpdated()))
        && (this.getVersion() == null ? other.getVersion() == null : this.getVersion().equals(
            other.getVersion()));
  }

  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
    result = prime * result + ((getAddress() == null) ? 0 : getAddress().hashCode());
    result = prime * result + ((getLatitude() == null) ? 0 : getLatitude().hashCode());
    result = prime * result + ((getLongitude() == null) ? 0 : getLongitude().hashCode());
    result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
    result = prime * result + ((getPassenger_id() == null) ? 0 : getPassenger_id().hashCode());
    result = prime * result + ((getCreated() == null) ? 0 : getCreated().hashCode());
    result = prime * result + ((getUpdated() == null) ? 0 : getUpdated().hashCode());
    result = prime * result + ((getVersion() == null) ? 0 : getVersion().hashCode());
    return result;
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append(getClass().getSimpleName());
    sb.append(" [");
    sb.append("Hash = ").append(hashCode());
    sb.append(", id=").append(id);
    sb.append(", address=").append(address);
    sb.append(", latitude=").append(latitude);
    sb.append(", longitude=").append(longitude);
    sb.append(", type=").append(type);
    sb.append(", passenger_id=").append(passenger_id);
    sb.append(", created=").append(created);
    sb.append(", updated=").append(updated);
    sb.append(", version=").append(version);
    sb.append(", serialVersionUID=").append(serialVersionUID);
    sb.append("]");
    return sb.toString();
  }
}
